package com.chap1;

import com.chap1.tools.SleepTools;

/**
 * <p>
 * <code>NewThread</code>
 * </p>
 *
 * @author junbao3
 * TODO
 * @date 2023-03-20 13:55
 * Copyright (C) 2021 IFlyTek. All rights reserved.
 */
public class NewThread {
    private static class UseThread extends Thread{
        @Override
        public void run() {
            super.run();
            SleepTools.second(1);
            System.out.println("I am extendec Thread");
        }
    }

    private static class UseRunnable implements Runnable{

        @Override
        public void run() {
            System.out.println("I am implements Runnable");
        }
    }

    public static void main(String[] args) {
        UseThread useThread = new UseThread();
        useThread.start();

        UseRunnable useRunnable = new UseRunnable();
        new Thread(useRunnable).start();
        System.out.println("main end");
    }
}
